<?php 
namespace Home\Controller ; 

/**
 * 需登录才能访问
 */
class ExamController extends HomeController {
	function _initialize(){
		parent::_initialize();
	}

	function index(){
		$list = M('GoodsCategory')->where('is_test=1')->select();
		$this->assign('list' , $list);
		$this->display();
	}

	/**
	 * 机考测试页面
	 */
	function dotest(){ 
		//友情提示.
		$friend_info = get_static_category_info('EXAM_INFO');
		$this->assign('friend_info' , $friend_info);
		$this->display();
	}

	//开始考试界面
	function dostart(){

		if(IS_POST){
			//todo
			session('test_islogin' , I('post.usercode'));
			$cid = I('get.cid');
			$info = M('GoodsCategory')->where(array('id' => $cid))->find();
			$this->assign('islogin' , 1);
			$this->assign('info' , $info);
			$this->display('do');
			exit;	
		}
		$islogin = session('test_islogin');
		if(!$islogin){
			$this->assign('islogin' , 0);
			$this->display('do');
			exit;
		}
		$this->display('do');
	}
	//考试进行中页面 
	function doing(){
		$student_know = get_static_category_info('EXAM_STU_KNOW');
		dump($student_know);
		$this->assign('student_know' , $student_know);
		$this->display();
	}



	//考试记录
	function record(){}
	//按章练习
	function exercise(){}
	//练习记录
	function history(){}
	//收藏记录
	function collect(){}
	//错题记录
	function error(){}

	//大纲 
	function outline(){}
}